<template>
  <el-scrollbar max-height="calc(100vh - 50px)">
    <div class="os-navigation">
      <div class="os-navigation--items"
           v-for="nl in navigationList"
           :key="nl.value"
           :id="`section-${nl.value}`">
        <div class="os-navigation__title">{{nl.name}}</div>
        <div class="os-navigation--content">
          <a target="_blank"
             v-for="i in nl.items"
             :key="i.name"
             :href="i.url">
            <div class="os-navigation__card">
              <div class="card-img"
                   :style="{backgroundImage: `url('${i.icon}')`}"></div>
              <div class="card-items">
                <div class="card-items__title">{{i.name}}</div>
                <div class="card-items__desc">{{i.description}}</div>
              </div>
            </div>
          </a>
        </div>
      </div>
    </div>
  </el-scrollbar>
</template>
<script lang="ts">
  import { defineComponent } from 'vue'
  import navigationList from './navigation-list'

  export default defineComponent({
    name: 'navigation',
    setup() {
      return { navigationList }
    },
  })
</script>
<style lang="scss" scoped>
  @include b(navigation) {
    max-width: 1600px;
    margin: 0 auto;
    @include m(items) {
      padding-top: 15px;
    }
    @include e(title) {
      font-size: 18px;
      margin-bottom: 8px;
      font-weight: bold;
      @include jbfont();
    }
    @include m(content) {
      display: flex;
      flex-wrap: wrap;
    }
    @include e(card) {
      margin: 8px;
      width: 250px;
      height: 65px;
      border-radius: 4px;
      box-shadow: 0px 0px 8px 0px $--color-jb5;
      @include jbbg(188deg, $--color-jb5, $--color-jb6);
      display: flex;
      align-items: center;
      justify-content: space-between;
      &:hover {
        box-shadow: 0px 2px 15px 0px $--color-jb5;
        cursor: pointer;
      }
      .card-img {
        margin: 0 8px;
        width: 32px;
        height: 32px;
        background-repeat: no-repeat;
        background-size: contain;
      }
      .card-items {
        flex: 1;
        margin-right: 8px;
        &__title {
          font-size: 14px;
          margin-bottom: 4px;
          color: $--color-font;
        }
        &__desc {
          font-size: 12px;
          color: $--color-desc;
        }
      }
    }
  }
</style>